package com.aaa.controller;

import com.aaa.entity.Facilty;
import com.aaa.service.FaciltyService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * (Facilty)表控制层
 *
 * @author makejava
 * @since 2022-01-12 13:27:05
 */
@RestController
@RequestMapping("facilty")
public class FaciltyController {
    /**
     * 服务对象
     */
    @Resource
    private FaciltyService faciltyService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne")
    public Facilty selectOne(Integer id) {
        return this.faciltyService.queryById(id);
    }

//    添加房间设施
    @RequestMapping("saveFacilty")
    public Object saveFacilty(Facilty facilty){
        Facilty facilty1=faciltyService.insert(facilty);
        return facilty1;
    }
}